import request from '@/utils/request.js'

export const userManagementAPI = {
  // 获取用户列表
  getUsers: (params = {}) => {
    return request({
      url: '/api/users/list',
      method: 'post',
      data: params
    })
  },

  // 更新用户
  updateUser: (data) => {
    return request({
      url: '/api/users',
      method: 'put',
      data
    })
  },

  // 删除用户
  deleteUser: (id) => {
    return request({
      url: `/api/users/${id}`,
      method: 'delete'
    })
  },

  // 根据ID获取用户
  getUserById: (id) => {
    return request({
      url: `/api/users/${id}`,
      method: 'get'
    })
  }
}